PCX2GRP graphics converter
(c) copyright 2000 by Eckhard Stolberg (Eckhard_Stolberg@web.de)


PCX2GRP is a simple program that I use for creating the data for the
player graphics in my Atari VCS 2600 games. It takes PCX graphics files
with a resolution of 320 by 200 pixels and 256 colours and converts them
into assembler data tables that can be included into the game source code.
That way I can use any of the many graphics programs, that can edit this
format, to design the moving objects for my games. PCX2GRP will start
scanning the picture in the top left corner and interpret all colour
values between 0 and 127 as pixels of an object and all colour values
between 128 and 255 as pixels of the background.

I have included two sample PCX files that contain the colour palettes for
NTSC (ntsc.pcx) and PAL (pal.pcx) VCS consoles. The palettes were taken
from John Saeger's z26 emulator.

To convert a PCX file you simple have to type a command like this at the
DOS command line prompt:

PCX2GRP [flags] PCXFILE.PCX DATAFILE.ASM

The flags that you can specify are:

-x##    Number of objects per row. Player objects on the VCS are always
        8 pixels wide and PCX2GRP starts scanning in the top left corner
        of the graphics file, so align your objects accordingly. Since
        the graphics file is 320 pixels wide and the player objects are
        at least 8 pixels wide each, this number can be a maximum of 40.

-y###   Number of objects per collumn. Player objects on the VCS can have
        any height up to the screen size. Since the graphics file must be
        200 pixels height, this value can be a maximum of 200.

-h###   Height of one object. Due to the format restrictions for PCX files,
        this value can be a maximum of 200.

-r#     Number of pixels in the graphics file per object pixel. The
        horizontal resolution of the VCS is 160 pixels. To be able to
        see the player objects in the original proportion while editing
        you might want to use two pixels in the PCX file to represent
        one pixel of the object. Also the VCS allows the programmer to
        double or quadrouple the size of the object pixels. To allow you
        to edit the objects in the same fashion, this flag lets you skip
        every so many pixels while scanning the PCX file.

-d      Skip every other line. Many VCS games use a double scanline
        resolution to get enough cycles to update all the graphics. If
        you want to edit your player objects this way, you can tell PCX2GRP
        to skip every other scanline while scanning the graphics file.

-c      Suppress the generation of colour data. By default PCX2GRP creates
        one table per object for the shape and one for the colour information.
        If you want to use only monochrome objects, you can use this flag.

-o      Scan top-down instead of bottom-up. Most programs count down the
        index pointer into the graphics data as the display advances.
        Therefore PCX2GRP generates the graphics table from the last line
        to the first. If your program has to count up the index pointer, you
        can use this flag.

-p      Align data on page boundaries. The 6507 processor in the VCS takes
        an extra cycle, if an indexed access to a data table crosses a 256
        byte page boundary. If you have a lot of graphics data and want to
        make sure that no access to it has to go across a page boundary,
        use this flag. Then the data table will be filled up with zeros, if
        the data for a new object would cross a page boundary.

-a      Generate data for the ASM6502 assembler instead of the DASM
        assembler. ASM6502 is an old assembler that I used before I found
        DASM. It requires to define bytes in a different way. This flag
        is only left in for historic reasons.

-l      Interpret colours values between 128 and 255 as object pixels and
        colour values between 0 and 127 as background pixels. If for some
        reason your preferred painting program makes it easier to create
        the graphics with this setup, use this flag.

